home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-10-13 | 1.8 KB | 44 lines | [TEXT/GEOL] |
- Item 2762371 12-Oct-89 16:19
-
- From: D4071 Aapps, Russ Wetmore,PRT
-
- To: D2086 Efficient Field Svc, C Faith,PRT
-
- cc: MACAPP.TECH$ MACAPP Tech
-
- Sub: Re: Changing MacApp Source
-
- Curtis -
-
- It's not _always_ necessary to alter the given objects to do what you're
- suggesting.
-
- In ViewEdit, for example, all view objects needed to be selectable,
- resizable, relocatable, reorderable, etc. One option was add methods to
- TView in the MacApp source code, which would have made it difficult to
- upgrade to a new version of MacApp. Another was to override every
- available view object and add redundant methods to each. Neither option
- seemed desirable.
-
- What I eventually did (thanks to a suggestion from David Goldsmith) was
- create a view "holder" object, implement the necessary common
- functionality there, and imbed each view object in a holder. The view
- holder handles these common tasks, with events and choices being passed on
- to the view holder from its subordinate view when necessary. Sort of a
- poor man's multiple inheritance.
-
- This trick obviously depends on the way the view hierarchy works. As a
- more general solution, I suggested once that abstract objects should be
- inserted into the object hierarchy ahead of the lower base classes,
- subject to compile-time variables. Thus, TView could be derived from a
- TAbstractView (derived in turn from TEvtHandler), with the source to
- TAbstractView coming from an included file which would remain external to
- the MacApp sources. (This would be similar to the way additional view
- type definitions can be added to ViewTypes.r at compile time.) I was
- outvoted at the time, but I still think it's a good idea.
-
- 'Course, if Object Pascal handled multiple inheritance, this discussion
- would be moot... :-)
- [ Russ ]
-
-